from django.contrib.auth.models import User
from project.core.models import UserProfile
from django.core.exceptions import ObjectDoesNotExist

def get_or_create_profile(user):
	try:
		profile = user.get_profile()
	except ObjectDoesNotExist:
		#create profile - CUSTOMIZE THIS LINE TO OYUR MODEL:
		profile = UserProfile(karma='1', url='http://example.org', user=user)
		profile.save()
	return profile
